package unitPackage;
import itemPackage.*;
import java.util.ArrayList;

public abstract class AUnit {

	private String name;
	private int hp, ap, attack, defense, mAttack, mDefense, dexterity, speed, agility, moveDistance, direction, level, experience, battleHp, battleAp;
	private AWield primarySlot, secondarySlot;
	private AArmor headSlot, bodySlot, handSlot, legSlot, feetSlot, acessorySlot1, acessorySlot2;
	private ACaste currCaste;
	
	public int getBattleHp() {
		return battleHp;
	}

	public void setBattleHp(int battleHp) {
		this.battleHp = battleHp;
	}

	public int getBattleAp() {
		return battleAp;
	}

	public void setBattleAp(int battleAp) {
		this.battleAp = battleAp;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getHp() {
		return hp;
	}
	
	public void setHp(int hp) {
		this.hp = hp;
	}
	
	public int getAp() {
		return ap;
	}
	
	public void setAp(int ap) {
		this.ap = ap;
	}
	
	public int getAttack() {
		return attack;
	}
	
	public void setAttack(int attack) {
		this.attack = attack;
	}
	
	public int getDefense() {
		return defense;
	}
	
	public void setDefense(int defense) {
		this.defense = defense;
	}
	
	public int getmAttack() {
		return mAttack;
	}
	
	public void setmAttack(int mAttack) {
		this.mAttack = mAttack;
	}
	
	public int getmDefense() {
		return mDefense;
	}
	
	public void setmDefense(int mDefense) {
		this.mDefense = mDefense;
	}
	
	public int getDexterity() {
		return dexterity;
	}
	
	public void setDexterity(int dexterity) {
		this.dexterity = dexterity;
	}
	
	public int getSpeed() {
		return speed;
	}
	
	public void setSpeed(int speed) {
		this.speed = speed;
	}
	
	public int getAgility() {
		return agility;
	}
	
	public void setAgility(int agility) {
		this.agility = agility;
	}
	
	public int getMoveDistance() {
		return moveDistance;
	}
	
	public void setMoveDistance(int moveDistance) {
		this.moveDistance = moveDistance;
	}
	
	public int getDirection() {
		return direction;
	}
	
	public void setDirection(int direction) {
		this.direction = direction;
	}
	
	public int getLevel() {
		return level;
	}
	
	public void setLevel(int level) {
		this.level = level;
	}
	
	public int getExperience() {
		return experience;
	}
	
	public void setExperience(int experience) {
		this.experience = experience;
	}
	
	public AWield getPrimarySlot() {
		return primarySlot;
	}
	
	public void setPrimarySlot(AWield primarySlot) {
		this.primarySlot = primarySlot;
	}
	
	public AWield getSecondarySlot() {
		return secondarySlot;
	}
	
	public void setSecondarySlot(AWield secondarySlot) {
		this.secondarySlot = secondarySlot;
	}
	
	public AArmor getHeadSlot() {
		return headSlot;
	}
	
	public void setHeadSlot(AArmor headSlot) {
		this.headSlot = headSlot;
	}
	
	public AArmor getBodySlot() {
		return bodySlot;
	}
	
	public void setBodySlot(AArmor bodySlot) {
		this.bodySlot = bodySlot;
	}
	
	public AArmor getHandSlot() {
		return handSlot;
	}
	
	public void setHandSlot(AArmor handSlot) {
		this.handSlot = handSlot;
	}
	
	public AArmor getLegSlot() {
		return legSlot;
	}
	
	public void setLegSlot(AArmor legSlot) {
		this.legSlot = legSlot;
	}
	
	public AArmor getFeetSlot() {
		return feetSlot;
	}
	
	public void setFeetSlot(AArmor feetSlot) {
		this.feetSlot = feetSlot;
	}
	
	public AArmor getAcessorySlot1() {
		return acessorySlot1;
	}
	
	public void setAcessorySlot1(AArmor acessorySlot1) {
		this.acessorySlot1 = acessorySlot1;
	}
	
	public AArmor getAcessorySlot2() {
		return acessorySlot2;
	}
	
	public void setAcessorySlot2(AArmor acessorySlot2) {
		this.acessorySlot2 = acessorySlot2;
	}
	
	public ACaste getCurrCaste() {
		return currCaste;
	}
	
	public void setCurrCaste(ACaste currCaste) {
		this.currCaste = currCaste;
	}
	
	public ArrayList<ArrayList<Integer>> battleMove()
	{
		
		ArrayList<ArrayList<Integer>> move = new ArrayList<ArrayList<Integer>>();
		ArrayList<Integer> sub; //why not generate new ArrayList<Integer> here?
		
		int currX, currY;
		
		for(int count = 0; count < moveDistance; count++){
			
			currX = 0;
			currY = -(moveDistance-count);
			
			while(currX < (moveDistance-count)){
				sub = new ArrayList<Integer>(2);
				sub.add(currX);
				sub.add(currY);
				move.add(sub);
				currX++;
				currY++;
			}
			while(currX > 0){
				sub = new ArrayList<Integer>(2);
				sub.add(currX);
				sub.add(currY);
				move.add(sub);
				currX--;
				currY++;
			}
			while(currX > -(moveDistance-count)){
				sub = new ArrayList<Integer>(2);
				sub.add(currX);
				sub.add(currY);
				move.add(sub);
				currX--;
				currY--;
			}
			while(currX < 0){
				sub = new ArrayList<Integer>(2);
				sub.add(currX);
				sub.add(currY);
				move.add(sub);
				currX++;
				currY--;
			}
		}
		
		return move;		
	}
}
